UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UT0wPvXvh4amQVoq7vWqWfEmYHEwImHEaWKFxwUCkOA='
WHERE
key_id = 'a8b73bd79910c6f4a2e5a45251b885cc6346ce37c084af09c02cb3adbe8fd903'
AND (
token = 'UT0wPvXvh4amQVoq7vWqWfEmYHEwImHEaWKFxwUCkOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)