UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LGLTuePGVbcCg352/xCYjOMhBrV8Ji3K5nJJlXG4H54='
WHERE
key_id = '2b5257bd1edf6e9781aac24c08fd9af83f43574f663d7531a6e95dcdc8ec687a'
AND (
token = 'LGLTuePGVbcCg352/xCYjOMhBrV8Ji3K5nJJlXG4H54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)