UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NOUcScF5oLUH9oiBNKIqOHBuLsbW4HPD3uoW/dWdNx0='
WHERE
key_id = 'c1f43439d40844d8bff76f540a182b49928e93b8836ff859af38138933304bdd'
AND (
token = 'NOUcScF5oLUH9oiBNKIqOHBuLsbW4HPD3uoW/dWdNx0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)