UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EGR2kT1x965TwpJCmBjVNCGvNY98VRqWEkh+i2dHL6A=' 
WHERE 
  key_id = 'a36dc4228905de70d2632b780d52d6920621d708b04ff0209af85ce549c5da87' 
  AND (
    token = 'EGR2kT1x965TwpJCmBjVNCGvNY98VRqWEkh+i2dHL6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025