UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '389eeohW7e6oKTHogmTjrQuDNLtxhuatX08/DEhH/nY=' 
WHERE 
  key_id = 'ffface8d26caedc44f17e7a5719fd3f88bd8d8a477faf264d66bf8ae9b5d51b8' 
  AND (
    token = '389eeohW7e6oKTHogmTjrQuDNLtxhuatX08/DEhH/nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021