UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sU0u/43jnAIxr02IGyc0HvW6KC+m8Qwok7JwCIf/lMY='
WHERE
key_id = '71a31e8f56431874656b28fad3f4e921e993d481d17bf711b2a046873654a422'
AND (
token = 'sU0u/43jnAIxr02IGyc0HvW6KC+m8Qwok7JwCIf/lMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)