UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M0Pj0Sy3zSLjY/utG+HUhdczRRykSq1+zXrpeCcfK7s='
WHERE
key_id = '956fb12f5c28926546c8f77f4b00a6a0d144be08d58e30fb5ce3d8ed18ff889e'
AND (
token = 'M0Pj0Sy3zSLjY/utG+HUhdczRRykSq1+zXrpeCcfK7s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)