UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mkhCDPjcwNsWEYI9XTQfHti0BWzhNRXwZF/njvh0N5g='
WHERE
key_id = '9433c2d74cf64fd808c96b3f9daa459c1d56017dd0879bf0542adf2667fec589'
AND (
token = 'mkhCDPjcwNsWEYI9XTQfHti0BWzhNRXwZF/njvh0N5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)