UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SFMB/GLkjP81EBffZb/w7F1aGz+LNVyWHYr0+A750xs='
WHERE
key_id = 'f384beef7d6b221727a71578264adc8ac4f2937c376c709fe386bd2ecce95c7e'
AND (
token = 'SFMB/GLkjP81EBffZb/w7F1aGz+LNVyWHYr0+A750xs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)