UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wXQI4JjhCjL/gVlQuDxzJIfYzptnwWigqQcpzSe2SWU=' 
WHERE 
  key_id = '404d56d5c3a8ac56f705eb7df3e05dce6c9716664671c5e52be99a1b0aeeaa19' 
  AND (
    token = 'wXQI4JjhCjL/gVlQuDxzJIfYzptnwWigqQcpzSe2SWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033