UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AtdcNXd9cWudNUTg23ZiWG6pkTXTya/VuYrd5peebzw='
WHERE
key_id = 'b664b03e35724affed365f0d39c9c20aebdd58b4e3ff9052eb39c336174cb285'
AND (
token = 'AtdcNXd9cWudNUTg23ZiWG6pkTXTya/VuYrd5peebzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)