UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mMOWJLPLfWSOnQYPOStWZ2d/OLFpPToFH9e3jKH2rrI=' 
WHERE 
  key_id = '13e3728fd4906e47993feaf8c58d4880b79e5011164e2437af30968ac90b0af4' 
  AND (
    token = 'mMOWJLPLfWSOnQYPOStWZ2d/OLFpPToFH9e3jKH2rrI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020