UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZvudaHf27sXigzIqhDuMZFodoGjwjk62Hrz3uGYYu9U='
WHERE
key_id = '3b6ea36e97935654b14bd786cbf69eebae570a176fcf177c652fb12f1fcc9e63'
AND (
token = 'ZvudaHf27sXigzIqhDuMZFodoGjwjk62Hrz3uGYYu9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)