UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kkkb9x8MJqJy9/fJdcSfOyfkr2Ko3r1X+JUvCe210jc='
WHERE
key_id = '2b554a303fde1e622cdd992f0bc47bccfa15af9136f91c9b722260625399fcc2'
AND (
token = 'Kkkb9x8MJqJy9/fJdcSfOyfkr2Ko3r1X+JUvCe210jc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)