UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '67P0QB48ktyb/bMiIpEX7G4NTAkdA9ehVtmuSNAQVdQ=' 
WHERE 
  key_id = '53e83a47699af76acf9f69c3a649fa1dfd54a0e11d9354dfd67af014e9c4299d' 
  AND (
    token = '67P0QB48ktyb/bMiIpEX7G4NTAkdA9ehVtmuSNAQVdQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055