UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wi8QSKCViRLPT69ZR9w2kuLfpLKxDO3055+wbx/5q3w='
WHERE
key_id = '68022f07d035cf25b6c0236047270d3356ed5be9f021a31936ebf4c9264061b8'
AND (
token = 'wi8QSKCViRLPT69ZR9w2kuLfpLKxDO3055+wbx/5q3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)