UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vn9q0XnTLBtDLTKjrlpr3Qos4t00WOoaUJnO7pI9O7k=' 
WHERE 
  key_id = '9ba8afa778575341d4ea88ce144084f6da1185a8a56eaed2e9b7d68e9bd75edd' 
  AND (
    token = 'vn9q0XnTLBtDLTKjrlpr3Qos4t00WOoaUJnO7pI9O7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032