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

Query time 0.00017