UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2udj0U9O5vLFw5lkhay+JwLeAp9iF5KDE+wlwVJP55I='
WHERE
key_id = 'ed3943888b8e2cade3e1b494bd0949a7761ad2fa14743372770ee34f001111c9'
AND (
token = '2udj0U9O5vLFw5lkhay+JwLeAp9iF5KDE+wlwVJP55I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)