UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h99zHmERZBkgYdLCp/YVwHPddd0SNTfv1Zl2JMiIQ/g='
WHERE
key_id = '79a873b0c82d3048cebabd9ce66cfbbe9ce1d3720382afe5bdc3179f0c4ded61'
AND (
token = 'h99zHmERZBkgYdLCp/YVwHPddd0SNTfv1Zl2JMiIQ/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)