UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ok7+YzjYEk+L5Lqve1dgPsyD9vkatFLR1QWmUC2OaB4='
WHERE
key_id = '3f3d3759c2ec426e3e4b6e694e441a0f541dc5a35a73e2f76934bbfa0a305996'
AND (
token = 'Ok7+YzjYEk+L5Lqve1dgPsyD9vkatFLR1QWmUC2OaB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)