UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nWKT868U8z4zT1iEaqq0rgjgkP4PPQ2hubZLvqJCkoE=' 
WHERE 
  key_id = 'e1e0f42b33c67ecbb52579e239fdf3ffc61703781d9984b5f8507d92b46419c9' 
  AND (
    token = 'nWKT868U8z4zT1iEaqq0rgjgkP4PPQ2hubZLvqJCkoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028