UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lMd+x10vG2DcJgZ3kYMCTThnsMbqLMbGQppvETcMCXI=' 
WHERE 
  key_id = '542b8f1bd4eaa43c8a5ed46be839bf500725cf57a485aa83d51bb9ac9319f43c' 
  AND (
    token = 'lMd+x10vG2DcJgZ3kYMCTThnsMbqLMbGQppvETcMCXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035