UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0bMOuSIYmXAaOdPg8xhM7Gv3qWQyOykioDiD/fuONrA='
WHERE
key_id = '62aa7359fcf5025f826c5a76b34baf734d6d855f5c328d77ab45a53171607e8e'
AND (
token = '0bMOuSIYmXAaOdPg8xhM7Gv3qWQyOykioDiD/fuONrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)