UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '58iuKewT8wZzEXIOvyqjSxd2T+eJ8lCXXLnqY1OdSsQ='
WHERE
key_id = '945aeacc3963548a2dc49fa043b8ac34e4679c657414ad3194c064a579c9d3fe'
AND (
token = '58iuKewT8wZzEXIOvyqjSxd2T+eJ8lCXXLnqY1OdSsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)