UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yJnp/q4stV2hUONvi0P4eAkfz846W7C++5vbBybsW1U='
WHERE
key_id = '0ee00caa3878ba58df047c926274c52456901fafe4e072749f700f2b8cd9bda5'
AND (
token = 'yJnp/q4stV2hUONvi0P4eAkfz846W7C++5vbBybsW1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)