UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+WjgYg18QM/TeqrWvaxJOwnYXst0q4wjlR1RWPx/FWU='
WHERE
key_id = '122f0a03e6db884e8596a449ba4f46f5ce5e3781974076dcb906c1007d338044'
AND (
token = '+WjgYg18QM/TeqrWvaxJOwnYXst0q4wjlR1RWPx/FWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)