UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0js/vCrl9oN/tdZqGaJ06JZddMFPd9fDTm+x9PqC7Uk='
WHERE
key_id = '5f1a606c8c03dd77c4e7510fdebfabb9d1e135ca50e3c4470c8ea285d942fece'
AND (
token = '0js/vCrl9oN/tdZqGaJ06JZddMFPd9fDTm+x9PqC7Uk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)