UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mmpCcxGL1n8+tkQUL+f4DKvmzfKLgafTl7i4NQ4qlBI='
WHERE
key_id = '368d77a280a08635a197f75ee72d93b50e1e68ecf7eebac037ea2d98149282fa'
AND (
token = 'mmpCcxGL1n8+tkQUL+f4DKvmzfKLgafTl7i4NQ4qlBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)