UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fv/LtUh9nJzwmV3iOGUQ47Cbol+yipYYoEjdGq4JqxU='
WHERE
key_id = 'c83f70bfba62f2c5b23117dfc384264a8641abc11a0969c43f0da0e2c2ed9812'
AND (
token = 'fv/LtUh9nJzwmV3iOGUQ47Cbol+yipYYoEjdGq4JqxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)