UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dzp0JJT/lNQiWZDDSiMvPonK1R+P8HKI9ZlJArH5dgQ=' 
WHERE 
  key_id = '2e1c142dbfe2c352cb9fb38c090dddac6b5767d380d60ee809a62430e45a6654' 
  AND (
    token = 'dzp0JJT/lNQiWZDDSiMvPonK1R+P8HKI9ZlJArH5dgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028