UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wTvFlGbCvfMI+kXOxRG5WExpqs9Zo/uWaZutyovkzS0='
WHERE
key_id = 'ee329ab7aabd753932e33e16a9080d8b4728a1719858e45e293c74fa8b7ce764'
AND (
token = 'wTvFlGbCvfMI+kXOxRG5WExpqs9Zo/uWaZutyovkzS0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)