UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7il2v1Y4Ge/m/JinPg8vJZZLsBKBwm6ksC3Ou/G0fDc=' 
WHERE 
  key_id = '07307806477d46e8cb6a4545db80fa57fc3e4e0273435c83ffb12d4667a8a96f' 
  AND (
    token = '7il2v1Y4Ge/m/JinPg8vJZZLsBKBwm6ksC3Ou/G0fDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030