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