UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4DP1kjy5jpt6xSe1V4tGG7Q9L4lBBQUJutxfPufXb8A='
WHERE
key_id = 'dc223059381e1e03b69341a9ac66530cfb23377e3aa5c7eb7e84b96e065c6aa2'
AND (
token = '4DP1kjy5jpt6xSe1V4tGG7Q9L4lBBQUJutxfPufXb8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)