UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BXPj9w9tcBRl4Qk6k0R/peUr5/ygzLl7jNoLVbx6DXY='
WHERE
key_id = 'e32dd5f7ff0dafc845c7ef2e6f5f30628f2fcde48fa4c07fe1774cde2cab5b13'
AND (
token = 'BXPj9w9tcBRl4Qk6k0R/peUr5/ygzLl7jNoLVbx6DXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)