UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Z2CzL1Qzt0cKqRiZ9Jg2o3j8/vjFXtLH1XPomsGKUM='
WHERE
key_id = '9305e70fd414b71becf4d996cd1bea1b0b78cde5ca59104d2e55647fc75502a1'
AND (
token = '0Z2CzL1Qzt0cKqRiZ9Jg2o3j8/vjFXtLH1XPomsGKUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)