UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J5YAZzsvBaF9FFTvinOax+gRajWTq+6jDthwQofKSNQ=' 
WHERE 
  key_id = 'e9ab4833396eb006b8f04fda29d874fb5a8a279f20f1c85f51cb3ff3b5273acf' 
  AND (
    token = 'J5YAZzsvBaF9FFTvinOax+gRajWTq+6jDthwQofKSNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066