UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W3x+boeBeV/b5eaLcy2YDyWPeD8OTisqam1wIxs73BA='
WHERE
key_id = '003302077948ea47637571ac062fffd53f1e87714d6a10ba7e2ef285927d5165'
AND (
token = 'W3x+boeBeV/b5eaLcy2YDyWPeD8OTisqam1wIxs73BA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)