UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yz34H1javnMHPnPG+eAZSFKIfBo6LFmcwXTZ2HEAfn8='
WHERE
key_id = '32d625547dcc5604f49e7d3f18e0966a9d881038db461ef4ea86aea52154cb74'
AND (
token = 'Yz34H1javnMHPnPG+eAZSFKIfBo6LFmcwXTZ2HEAfn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)