UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aXgO8H0l405OlEX9TtxqnJ1gsHITgY889W0yxW+y9SI='
WHERE
key_id = 'daceec4eb3df336ec352e9155ecf6f716189b6dfaa6ab4f3dcc641da94d04517'
AND (
token = 'aXgO8H0l405OlEX9TtxqnJ1gsHITgY889W0yxW+y9SI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)