UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2BBgk5pADmV3DBOAHCxu2kYeSEMJt6sMoH3p2srtDuY=' 
WHERE 
  key_id = 'ee852be36b49c07785a164be989d4bf9570d5d06979597276a8316252de452da' 
  AND (
    token = '2BBgk5pADmV3DBOAHCxu2kYeSEMJt6sMoH3p2srtDuY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033