UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1aLv3kKbe/k3LdNXCRPRKS20lEUwTlYBLxxa41nRMWQ=' 
WHERE 
  key_id = 'cee2649b7b6af5baa664790c8f437055c245c1b7bc327be0141b32d470c4e7a4' 
  AND (
    token = '1aLv3kKbe/k3LdNXCRPRKS20lEUwTlYBLxxa41nRMWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020