UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HkblKA+OoxDAKn6/nh25j52NO0V2HKrvBcXmFf0mTN4='
WHERE
key_id = 'a54240c17fb30a3ea4b8bbd78da36da4e8a3d75d40eb3ee27b9c889d5e7bcff6'
AND (
token = 'HkblKA+OoxDAKn6/nh25j52NO0V2HKrvBcXmFf0mTN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)