UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9p0mzEZh8gbhAdx18Wmwk1hJo/Iha/sMC3pm/d5mHyg='
WHERE
key_id = '8c9b95b43864cf1f1a5de7d27b12feefdcaef74c90bd5f08463663b2cfbdb241'
AND (
token = '9p0mzEZh8gbhAdx18Wmwk1hJo/Iha/sMC3pm/d5mHyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)