UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tin8Pk7Oiq8RgcR7UGovTujXsto1aLfQK9Cp40byNk4='
WHERE
key_id = '923dbb574af278a5ff8f7008da75f01a77a8709dd9314855b6fdc0bc7c1ed3e5'
AND (
token = 'tin8Pk7Oiq8RgcR7UGovTujXsto1aLfQK9Cp40byNk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)