UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+SjgeTODJkMOMpUdZqXT5Eord/dBB9ETR51BOrfT/nA=' 
WHERE 
  key_id = '0e02509516dd30560830adb9413ced7ad8caa272b98771db29528682d9f51ae7' 
  AND (
    token = '+SjgeTODJkMOMpUdZqXT5Eord/dBB9ETR51BOrfT/nA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023