UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jDh3QMp6hq9KFnlVn3yJ+RdD5KltU2jnoBXcmUURIhI='
WHERE
key_id = '81bc76fac1941f8fc7546353f160c32dbd3e408ffe3555130b58b4ad29f56f03'
AND (
token = 'jDh3QMp6hq9KFnlVn3yJ+RdD5KltU2jnoBXcmUURIhI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)