UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fVcSeH70Z1nRbsP2sXR2HGkWq0Z2pGotILx8I69tRQo=' 
WHERE 
  key_id = '4d28958ee5153a4013ea70c1c04c0b5fc1bee76b737cd45967e995cb3b99db83' 
  AND (
    token = 'fVcSeH70Z1nRbsP2sXR2HGkWq0Z2pGotILx8I69tRQo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022