UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+AwbL/3rxN6ZY5cx0/Wsp+UnwoOxn2RuxHQ3gpl92NY='
WHERE
key_id = '004e766c424391b790296cb197cafd36e35c9f6d6fc8f86050a82d2032c3e38e'
AND (
token = '+AwbL/3rxN6ZY5cx0/Wsp+UnwoOxn2RuxHQ3gpl92NY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)