UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yk8du8+xH2mTJ1m8Dqm/EsI5S4OnE5+XuY3ggk63pWU=' 
WHERE 
  key_id = 'fee7aaeef472ed0fbd1779408615d52b12e34fa49ca92ee3c4da8d488563bcb3' 
  AND (
    token = 'Yk8du8+xH2mTJ1m8Dqm/EsI5S4OnE5+XuY3ggk63pWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033