UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/wfgM5sc4DI0OXEsE0Thv75caqbJtdzbU6EE+R/vLxA=' 
WHERE 
  key_id = 'ff7f639fb49a2f9d078769f8aa80cb11c0c292cc65a3802a56ce8aec2d75c2f6' 
  AND (
    token = '/wfgM5sc4DI0OXEsE0Thv75caqbJtdzbU6EE+R/vLxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038