UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fVP8yCwlOxv/CnQCaB1V9xp7zXuyPBLvJ8PGWq6hqjU=' 
WHERE 
  key_id = '8e6c48aa0bb992e7dde155a9edb6eff3b638f5d97905e9601e57ea86c9e4dbfe' 
  AND (
    token = 'fVP8yCwlOxv/CnQCaB1V9xp7zXuyPBLvJ8PGWq6hqjU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029