UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1x1E8z8M9ZH8Yu08vjMQ8RCUKOgMIQ5KAdBeZYG20s0=' 
WHERE 
  key_id = 'eaa0d5a264f3f7965de9ac47ad3c0abcb206126860d22a0dd8177418889bd045' 
  AND (
    token = '1x1E8z8M9ZH8Yu08vjMQ8RCUKOgMIQ5KAdBeZYG20s0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025