UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VyLdvkR9b0wPQ+CQxzhbPuaL958iWjwHkhDiTl4/0ZA='
WHERE
key_id = 'fb489e5efc233206e877c3f936eeb7a7a38c4be456fc1a5f6dd13f1cfbc7cd4d'
AND (
token = 'VyLdvkR9b0wPQ+CQxzhbPuaL958iWjwHkhDiTl4/0ZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)