UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6jU7IoqJ/V7ikfyRgbAWRhTdxQDl+CM4rq8IqCmJxmY=' 
WHERE 
  key_id = '84e73747f701fbf3acd55872f5bf6c07c106289986b8377c703f55bd9caadcad' 
  AND (
    token = '6jU7IoqJ/V7ikfyRgbAWRhTdxQDl+CM4rq8IqCmJxmY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022