UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VWvBMGjHDuhhUmAV9paMrFGbL2YzTgxA2thBamHAjVc='
WHERE
key_id = 'b2a458f3bdb7bc055da8e4271feb41900b21dcdf123a44e43ccd2fa2151281d0'
AND (
token = 'VWvBMGjHDuhhUmAV9paMrFGbL2YzTgxA2thBamHAjVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)