UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Q5SElP8mWLjKJDOolRyAAw39W1Etl8e5oBI9s/9VfI='
WHERE
key_id = '118b1d2421e8014e6712613aecca96eaffb64f88c4104a5f623fa6109f337c77'
AND (
token = '9Q5SElP8mWLjKJDOolRyAAw39W1Etl8e5oBI9s/9VfI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)