UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jQ/iFnMjJXUGAlYQ9nzqglsNS8hR39jlSER4/0eWy1E='
WHERE
key_id = '774fcf9900ac05317b8deb1a0033e4b119ac02baf8151469375113c1dcbfdd1b'
AND (
token = 'jQ/iFnMjJXUGAlYQ9nzqglsNS8hR39jlSER4/0eWy1E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)